package cn.zz.veggie.model.sort;

import com.baomidou.mybatisplus.core.metadata.OrderItem;

import lombok.AllArgsConstructor;

/**
 * @author zhongq
 * @since 2024/7/20
 */
@AllArgsConstructor
public enum OrderSort {

	idDesc("id", SortType.desc),
	deliveryTimeDesc("delivery_time", SortType.desc);

	private final String column;
	private final SortType type;

	public OrderItem toOrderItem() {
		return new OrderItem().setColumn(this.column).setAsc(this.type.isAsc());
	}


}